<template>
    <view class="container">
        <button class="logout-btn" @click="logout">退出登录</button>
    </view>
</template>

<script>
export default {
    data() {
        return {};
    },
    methods: {
        logout() {
            uni.showModal({
                title: '提示',
                content: '确定要退出登录吗？',
                success: (res) => {
                    if (res.confirm) {
                        uni.reLaunch({
                            url: '/pages/login'
                        });
                    }
                }
            });
        }
    }
};
</script>

<style>
.container {
    padding: 20rpx;
    background-color: #f5f5f5;
}
</style>
